function animate(ele, target, cbk) {
	if(!ele.timerlist) ele.timerlist = [];
	stop();
	let status = {};
	for(let attr in target) {
		status[attr] = false;
		
		let timer = setInterval(()=>{
			
			let targetValue = target[attr]; //获取目标值
			let currentValue = parseInt(getStyle(ele)[attr]); //获取当前值
			if(attr == "opacity") {
				currentValue = getStyle(ele)[attr]*100;
			} 
			
			let speed = (targetValue-currentValue)/8; //计算速度
			speed = speed>0?Math.ceil(speed):Math.floor(speed); //速度取整
			
			if(attr=="opacity") {
				ele.style.opacity = (currentValue + speed)/100;
				ele.style.opacity = "filter=alpha(opacity="+(currentValue + speed)+")";
				if(ele.style.opacity*100 == targetValue) { //达到目标值
					clearInterval(timer);
					status.opacity = true;
					if( isStop() ) {
						cbk ? cbk() : "";
					}
				}
				
			} else {
				ele.style[attr] = currentValue + speed + "px"; //修改样式
				if( parseInt(ele.style[attr]) == targetValue ) { //达到目标值
					clearInterval(timer); //终止
					status[attr] = true;
					if( isStop() ) {
						cbk ? cbk() : "";
					}
				}
			}
		}, 30)
		ele.timerlist.push(timer);
		
	}
	
	function isStop(){
		for(let attr in status) {
			if(status[attr]==false) {
				return false;
			}
		}
		return true;
	}
	
	function getStyle(ele) {
		if(ele.currentStyle) {
			return ele.currentStyle;
		} else {
			return getComputedStyle(ele);
		}
	}
	
	function stop(){
		ele.timerlist.forEach((timer)=>{
			clearInterval(timer);
		})
		ele.timerlist = [];
	}
}

